package com.telecom.mapper;

import com.telecom.entity.Teacher;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface TeacherMapper {
    @Select("select * from teacher")
    List<Teacher> selectList();
    @Insert("insert into teacher(name,age,sex,address) values(#{name},#{age},#{sex},#{address})")
    int insert(Teacher teacher);
    @Delete("delete from teacher where id = #{id}")
    int delete(Integer id);
    @Update("update teacher set name = #{name},age = #{age},sex = #{sex},address = #{address} where id = #{id}")
    int update(Teacher teacher);
    @Select("select * from teacher where id = #{id}")
    Teacher selectById(Integer id);
}
